package com.leetomlee.cloud.common.designmodel.ObserveModel;

import com.google.common.collect.Lists;

import java.util.List;

public class ObservesImpl implements IObserve {
    private List<IObserve> observes = Lists.newArrayList();

    @Override
    public void sendMsg(String msg) {

    }

    public void register(IObserve iObserve) {
        observes.add(iObserve);
    }

    public void notifyAllObserve(String msg) {
        for (IObserve o : observes
                ) {
            o.sendMsg(msg);
        }
    }

}
